/**
 * Project: lionbule-java-test
 * 
 * File Created at 2011-10-25
 * $Id$
 * 
 * Copyright 1999-2100 Alibaba.com Corporation Limited.
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * Alibaba Company. ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with Alibaba.com.
 */
package javas.system;

import java.io.IOException;
import java.net.URL;
import java.net.URLClassLoader;

/**
 * TestUrlClassloader.
 * 2011-10-25 下午02:27:47 @author LionBule
 */
public class TestUrlClassloader {

    /**
     * @param args
     * @throws IOException 
     * @throws Exception 
     */
    public static void main(String[] args) throws Exception {
        URL url = new URL("file:/e:/testok.jar");
        System.out.println(url.getPath());
        
        URLClassLoader classLoader01 = new URLClassLoader(new URL[]{url}, null);
        URLClassLoader classLoader02 = new URLClassLoader(new URL[]{url}, null);
        
        URL urltest = classLoader01.getResource("testok.jar");
        System.out.println(urltest.getPath());
        
        Class personClass01 = Class.forName("com.test.AlifiPerson", true, classLoader01);
        Object personObject01 = personClass01.newInstance();
        
        Class personClass02 = Class.forName("com.test.AlifiPerson", true, classLoader02);
        Object personObject02 = personClass02.newInstance();
        
    }

}
